<template>
  <div class="dashboard-container">
    <div class="dashboard-text">name: {{ name }}</div>
    <el-button @click="add">addRoutes的使用</el-button>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'Dashboard',
  created() {
    console.log(this, 91)
  },
  methods: {
    add() {
      /* 添加完毕后不会显示在路由配置表中，但会生效 */
      this.$router.addRoutes([
        {
          path: '/abc',
          component: () => import('@/views/dashboard/abc.vue')
        }
      ])

      console.log(this, 8899)
    }
  },
  computed: {
    ...mapGetters(['name'])
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
